<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #box {
        height: 100px;
        width: 500px;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        box-shadow: 1px 1px 5px gray;
      }
      #box button {
        position: absolute;
        right: 5px;
        top: 5px;
      }
    </style>
  </head>
  <body>
    <div id="box">
      <button id="btnClose">X</button>
      通知....
    </div>

    <script>
      const box = document.getElementById("box");
      const btnClose = document.getElementById("btnClose");

      btnClose.onclick = function () {
        box.remove();
      };
    </script>
  </body>
</html>
